<template>
  <div>
    <Headers></Headers>
    <!-- 设置一级路由出口 -->
    <router-view></router-view>
    <!-- 在home或search下显示，在login或register下隐藏 -->
    <Footer v-show="$route.meta.show"></Footer>
  </div>
</template>

<script>
import Headers from "@/components/Header/index.vue";
import Footer from "@/components/Footer/index.vue";
export default {
  components: {
    Headers, Footer
  },
    // 组件挂在完毕向服务器发请求获取数据
  mounted () {
    this.$store.dispatch('home/getCategory')
  },
}
</script>

<style scoped>

</style>